<form action="" class="form-horizontal" role="form">
  <div class="form-group">
      <label class="col-sm-2 control-label">金牌会员名称</label>
      <div class="col-sm-2">
        <input type="text" class="form-control" name="name" placeholder="" datatype="*2-20" value="{$dealer.name}">
      </div>
  </div>
  
  <div class="form-group">
      <label class="col-sm-2 control-label">邮箱</label>
      <div class="col-sm-3">
        <input type="email" class="form-control" name="email" placeholder="作为客户登陆后台账户"  datatype="e" value="{$dealer.email}">
      </div>
  </div>
  
  <div class="form-group">
    <label class="col-sm-2 control-label">联系人</label>
    <div class="col-sm-2">
      <input type="text" class="form-control" name="contacts" placeholder="客户联系人" datatype="*" value="{$dealer.contacts}"/>
    </div>
  </div>
  
  <div class="form-group">
    <label class="col-sm-2 control-label">联系人手机</label>
    <div class="col-sm-2">
      <input type="text" class="form-control" name="tel" placeholder="客户联系人手机" datatype="phone" value="{$dealer.tel}"/>
    </div>
  </div>
  
  <div class="form-group">
    <label class="col-sm-2 control-label">金牌会员服务开始时间</label>
    <div class="col-sm-2">
      <input type="text" id="begin-time" class="form-control" name="begin_time" placeholder="选择客户服务开始的时间" datatype="*" value="<notempty name='dealer.begin_time'>{$dealer.begin_time|date='Y-m-d H:i',###}</notempty>">
    </div>
  </div>
  
  <div class="form-group">
    <label class="col-sm-2 control-label">金牌会员服务结束时间</label>
    <div class="col-sm-2">
      <input type="text" id="end-time" class="form-control" name="end_time" placeholder="选择客户服务结束的时间" datatype="*" value="<notempty name='dealer.end_time'>{$dealer.end_time|date='Y-m-d H:i',###}</notempty>">
    </div>
  </div>
  
  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-8">
      <input type="hidden" name="id" value="{$dealer.id}"/>
      <input type="hidden" name="applyId" value="{$_REQUEST['applyId']}"/>
      <empty name="dealer.id"><input type="hidden" name="wechat_uid" value="{$dealer.wechat_uid}"/></empty>
      <button type="submit" class="btn btn-primary submit" data-loading-txt="提交中，请稍后……" data-ajax-url="__CONTROLLER__/save" data-action-callback="1">保存更改</button>
    </div>
  </div>
  
</form>

<!-- datetimepicker -->
<link rel="stylesheet" href="__PUBLIC__/Style/Common/datetimepicker/bootstrap-datetimepicker.min.css">
<script src="__PUBLIC__/Style/Common/datetimepicker/bootstrap-datetimepicker.min.js"></script>
<script src="__PUBLIC__/Style/Common/datetimepicker/bootstrap-datetimepicker.zh-CN.js"></script>
<script type="text/javascript">
  $(function(){
    
    $("#begin-time").datetimepicker({
      "language": "zh-CN"
    });
    
    $("#end-time").datetimepicker({
      "language": "zh-CN"
    });
  });
  
  function actionCallback( data ) {
	  if ( data && data.id) {
		  location.href = "{:U('DistributionShopCertificate/dealerIndex')}?id="+data.id;
	  }
  }
</script>